import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";

class App extends React.Component {
  state = { num: 1 };

  componentDidMount() {
    // debugger;
    this.setState({
      num: 2,
    });

    Promise.resolve().then(() => {
      this.setState({
        num: 3,
      });
      this.setState({
        num: 4,
      });
    });

    this.setState({
      num: 5,
    });
  }
  render() {
    console.log(this.state.num);
    return <div>111</div>;
  }
}

(ReactDOM as any).createRoot(document.getElementById("root")).render(<App/>);
